const express = require('express')
const bodyParser = require('body-parser')

const blog = require('./routes/api/blog')
const leaveWorld = require('./routes/api/leaveWord')
const music = require('./routes/api/music')
const Case = require('./routes/api/case')
const user = require('./routes/api/User')
const introduce = require('./routes/api/introduce')

const app = express()
const port = process.env.PORT || 5000
// app.use('/serverImage', express.static(path.join(__dirname, 'serverImage')));
app.use(bodyParser.urlencoded({
  extended: false
}))
app.use(bodyParser.json())

// app.use('/',(req,res)=>{
//     res.send('123456')
// })

app.use('/api/blog', blog)
app.use('/api/leaveWorld', leaveWorld)
app.use('/api/music', music)
app.use('/api/case', Case)
app.use('/api/user', user)
app.use('/api/introduce', introduce)

app.listen(port, () => {
  console.log(`Server running on ${port} `);
})